﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Input;

namespace MVVM.ViewModel {
    public class StartViewModel : ViewModel {

        public StartViewModel() {

        }
        
        public ViewCommand startCommand;
        public ViewCommand StartCommand {
            get {
                if (startCommand == null)
                    startCommand = new ViewCommand(param => this.StartApplication());
                return startCommand;
            }
        }

        public ViewCommand exitCommand;
        public ViewCommand ExitCommand {
            get {
                if (exitCommand == null)
                    exitCommand = new ViewCommand(param => this.ExitApplication());
                return exitCommand;
            }
        }

        private void StartApplication() {
            NavigationActions.OpenCustomersView();
        }

        private void ExitApplication() {
            if(NavigationActions.QueryConfirmation("Close application.","Do you want to close the application?"))
                NavigationActions.CloseApplication();
        }
    }
}
